package com.ruoyi.client.controller;

import com.ruoyi.client.pojo.vo.HomeCarouselVo;
import com.ruoyi.client.pojo.vo.HomeInfoVo;
import com.ruoyi.client.service.IHomeService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Locale;

@Anonymous
@Api(tags = "首页轮播")
@RestController("ClientHomeController")
@RequestMapping("/home")
public class HomeController extends BaseController {
    @Resource
    private IHomeService homeService;

    @ApiOperation("获取首页轮播")
    @GetMapping("/index")
    public R<HomeInfoVo> index(){
        HomeInfoVo homeInfoVo = new HomeInfoVo();

        //获取轮播数据
        List<HomeCarouselVo> carouselList=homeService.getCarouselList();

        homeInfoVo.setCarouselList(carouselList);

//        List<Locale.CategoryVo> list = categoryService.selectCategoryVoList();
        return R.ok(homeInfoVo);
    }
}
